package com.wyp.design.pattern.behavior.state;

/**
 * 状态模式
 *
 * @author: Oliver
 * @time: 2021/1/22/20:24
 */
public class Test {

    public static void main(String[] args) {
        CourseVideoContext courseVideoContext = new CourseVideoContext();
        courseVideoContext.setCourseVideoState(new PlayState());

        System.out.println("当前状态:" + courseVideoContext.getCourseVideoState().getClass().getSimpleName());
        courseVideoContext.pause();

        System.out.println("当前状态:" + courseVideoContext.getCourseVideoState().getClass().getSimpleName());

        courseVideoContext.speed();

        System.out.println("当前状态:" + courseVideoContext.getCourseVideoState().getClass().getSimpleName());

        courseVideoContext.stop();

        System.out.println("当前状态:" + courseVideoContext.getCourseVideoState().getClass().getSimpleName());


        courseVideoContext.speed();
    }
}
